package com.jinken.controller;


import com.jinken.service.IGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GoodsController {


    @Autowired
    private IGoodsService goodsService;


    @RequestMapping("/goods/list")
    public String list(){
        goodsService.queryGoods();
        return "=======goodsList======";
    }


    @RequestMapping("/goods/add")
    public String add(){
        goodsService.queryGoods();
        return "=======goodsAdd======";
    }

    @RequestMapping("/goods/findById")
    public String findById(@RequestParam("id") String id){
        goodsService.findById(id);
        return "商品："+id;
    }
}
